<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>8 模板语法-指令</title>
    <script src="js/vue.global.js"></script>
    <script src="https://unpkg.com/vue-router@4"></script>
</head>
<body>
<div id = "app"></div>
<script type = "text/javascript">
    const app = Vue.createApp({
        myOption: 'hello!'
    })

    // 为自定义的选项 'myOption' 注入一个处理器。
    app.mixin({
        created() {
            const myOption = this.$options.myOption
            if (myOption) {
                document.write(myOption)
            }
        }
    })

    app.mount('#app') // => "hello!"
</script>
</body>
</html>